package com.jmb.api.model.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data;

import java.io.Serializable;

/**
 * 
 * @TableName api_test_case_execute_log
 */
@TableName(value ="api_test_case_execute_log")
@Data
public class ApiTestCaseExecuteLog extends BaseEntity  implements Serializable {
    /**
     * 用例执行日志id
     */
    @TableId(value = "id", type = IdType.AUTO)
    private Integer id;

    /**
     * 用例id
     */
    @TableField(value = "case_id")
    private Integer caseId;

    /**
     * 用例描述
     */
    @TableField(value = "case_desc")
    private String caseDesc;

    /**
     * 请求地址
     */
    @TableField(value = "case_url")
    private String caseUrl;

    /**
     * 0get,1post,2patch,3put,4delete,5head,6options,7trace
     */
    @TableField(value = "case_method")
    private Integer caseMethod;

    /**
     * 请求头
     */
    @TableField(value = "request_headers")
    private String requestHeaders;

    /**
     * 请求参数
     */
    @TableField(value = "request_params")
    private String requestParams;

    /**
     * 
     */
    @TableField(value = "request_body")
    private String requestBody;

    /**
     * 未清洗依赖数据前的原始header
     */
    @TableField(value = "raw_request_headers")
    private String rawRequestHeaders;

    /**
     * 未清洗依赖数据前的原始params
     */
    @TableField(value = "raw_request_params")
    private String rawRequestParams;

    /**
     * 未清洗依赖数据前的原始json
     */
    @TableField(value = "raw_request_body")
    private String rawRequestBody;

    /**
     * 响应状态码
     */
    @TableField(value = "response_code")
    private Integer responseCode;

    /**
     * 响应头
     */
    @TableField(value = "response_headers")
    private String responseHeaders;

    /**
     * 响应正文
     */
    @TableField(value = "response_body")
    private String responseBody;

    /**
     * 运行时长ms
     */
    @TableField(value = "run_time")
    private Long runTime;

    /**
     * 执行人
     */
    @TableField(value = "executer")
    private String executer;

    /**
     * 运行结果 0成功 1失败 2错误
     */
    @TableField(value = "status")
    private Integer status;


    /**
     * 执行失败异常错误信息
     */
    @TableField(value = "error_message")
    private String errorMessage;

    /**
     * 测试套件执行日志编号
     */
    @TableField(value = "suite_log_no")
    private String suiteLogNo;

    /**
     * 测试套件执行日志编号(可记录接口依赖的case)
     */
    @TableField(value = "suite_log_detail_no")
    private String suiteLogDetailNo;

    /**
     * 日志执行调用链list
     */
    @TableField(value = "chain")
    private String chain;

    /**
     * 是否为失败重跑用例0是1否
     */
    @TableField(value = "is_failed_retry")
    private Integer isFailedRetry;

    /**
     * 来源（0用例调试 1依赖调试 2运行整个测试套件 3测试套件单个用例调试 4依赖解析 5综合用例-前置用例）
     */
    @TableField(value = "source")
    private Integer source;

    /**
     * raw类型 "Text" "JSON" "HTML" "XML"
     */
    @TableField(value = "raw_type")
    private String rawType;

    /**
     * 请求体类型0form-data 1x-www-form-Encoded 2raw 9none
     */
    @TableField(value = "body_type")
    private Integer bodyType;
}